package com.model;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Iterator;

/**
 * Created by shugen on 2017/1/5.
 */
public class Result {
    private String n1;
    private String n2;
    private String n3;
    private String n4;
    private String n5;
    private String n6;
    private String n7;
    private String n8;
    private String n9;
    private String n10;
    private String n11;
    private String n12;
    private String n13;
    private String n14;
    private String n15;
    private String n16;
    private String n17;
    private String n18;
    private String n19;
    private String n20;
    private String n21;

    public String getN1() {
        return n1;
    }

    public void setN1(String n1) {
        this.n1 = n1;
    }

    public String getN2() {
        return n2;
    }

    public void setN2(String n2) {
        this.n2 = n2;
    }

    public String getN3() {
        return n3;
    }

    public void setN3(String n3) {
        this.n3 = n3;
    }

    public String getN4() {
        return n4;
    }

    public void setN4(String n4) {
        this.n4 = n4;
    }

    public String getN5() {
        return n5;
    }

    public void setN5(String n5) {
        this.n5 = n5;
    }

    public String getN6() {
        return n6;
    }

    public void setN6(String n6) {
        this.n6 = n6;
    }

    public String getN7() {
        return n7;
    }

    public void setN7(String n7) {
        this.n7 = n7;
    }

    public String getN8() {
        return n8;
    }

    public void setN8(String n8) {
        this.n8 = n8;
    }

    public String getN9() {
        return n9;
    }

    public void setN9(String n9) {
        this.n9 = n9;
    }

    public String getN10() {
        return n10;
    }

    public void setN10(String n10) {
        this.n10 = n10;
    }

    public String getN11() {
        return n11;
    }

    public void setN11(String n11) {
        this.n11 = n11;
    }

    public String getN12() {
        return n12;
    }

    public void setN12(String n12) {
        this.n12 = n12;
    }

    public String getN13() {
        return n13;
    }

    public void setN13(String n13) {
        this.n13 = n13;
    }

    public String getN14() {
        return n14;
    }

    public void setN14(String n14) {
        this.n14 = n14;
    }

    public String getN15() {
        return n15;
    }

    public void setN15(String n15) {
        this.n15 = n15;
    }

    public String getN16() {
        return n16;
    }

    public void setN16(String n16) {
        this.n16 = n16;
    }

    public String getN17() {
        return n17;
    }

    public void setN17(String n17) {
        this.n17 = n17;
    }

    public String getN18() {
        return n18;
    }

    public void setN18(String n18) {
        this.n18 = n18;
    }

    public String getN19() {
        return n19;
    }

    public void setN19(String n19) {
        this.n19 = n19;
    }

    public String getN20() {
        return n20;
    }

    public void setN20(String n20) {
        this.n20 = n20;
    }

    public String getN21() {
        return n21;
    }

    public void setN21(String n21) {
        this.n21 = n21;
    }


    public String toString() {
        String s = "";
        Field[] field = this.getClass().getDeclaredFields();
        for (int j = 0; j < field.length; j++) {     //遍历所有属性
            String name = field[j].getName();    //获取属性的名字
            s += name + " : ";
            Method m = null;
            try {
                m = this.getClass().getMethod("get" + name.toUpperCase());
            } catch (NoSuchMethodException e) {
                e.printStackTrace();
            }
            try {
                String value = (String) m.invoke(this);    //调用getter方法获取属性值
                s+=value+"\n";
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            } catch (InvocationTargetException e) {
                e.printStackTrace();
            }
        }
            return s;

    }
}
